# https://leetcode.cn/problems/remove-duplicates-from-sorted-array/?envType=problem-list-v2&envId=array
from typing import List


class Solution:
    def removeDuplicates(self, nums: List[int]) -> int:
        nums[:] = sorted(set(nums))
        return len(nums)


if __name__ == '__main__':
    s = Solution()
    print(s.removeDuplicates([1, 1, 2]))
